<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>供需对接服务系统--发布结果公示</title>
    <!--公用样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
    <!--页面样式-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/style.css"/>
    <!--Layui-->
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!--extended-->
    <link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
    <!--公用样式JS-->
    <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${re.contextPath}/plugin/supplier/common/js/tel.js" charset="utf-8"></script>

</head>
<style>
    .Right {
        width: 100%;
        overflow-y: scroll;
    }

    .release ul:nth-child(2) li label {
        width: 28%;
    }

    .release ul:first-child li label {
        width: 23%;
    }

    .release .address, .personnel .address {
        width: 65%;
    }

    .xm-search-input {
        width: 90% !important;
        height: 34px !important;
        border: 1px solid #DDDDDD !important;
        padding-left: 20px !important;

    }

</style>

<body>
<!--头部-->
<header class="whitebg"></header>
<!--容器-->
<div class="container clearfix">
    <!--占位-->
    <!--右侧内容-->
    <div class="Right fr ">
        <form class="layui-form" id="myForm">
            <input id="supProjectId" name="supProjectId" type="hidden" value="${supProjectId}">
            <input id="zbBy" name="supProjectId" type="hidden" value="${project.zbBy}">
            <input id="zbCompany" name="zbCompany" type="hidden" value="${project.zbCompany}">
            <div class="windows whitebg ">
                <div style="width: 80%;padding-left: 40px;">
                    <ul>
                        <li>
                            <span class="gary">项目名称：</span>
                            <span>${project.projectName}</span>
                        </li>
                        <li>
                            <span class="gary">发布单位：</span>
                            <span>${pushcompany}</span>
                        </li>
                        <li>
                            <span class="gary">中标单位：</span>
                            <span>${zbcompany}</span>
                        </li>
                        <li>
                            <span class="gary">中标人：</span>
                            <span>${zbusername}</span>
                        </li>
                        <#if "${project.projectType}"?contains("001") >
                            <li >
                                <span class="gary">监理项目经理：</span>
                                <span>${jlmanagename}</span>
                            </li>
                        </#if>
                        <#if "${project.projectType}"?contains("002") >
                            <li >
                                <span class="gary">咨询项目经理：</span>
                                <span>${zxmanagename}</span>
                            </li>
                        </#if>
                        <#if "${project.projectType}"?contains("003") >
                            <li >
                                <span class="gary">检测项目经理：</span>
                                <span>${jcmanagename}</span>
                            </li>
                        </#if>
                        <#if "${project.projectType}"?contains("100") >
                            <li >
                                <span class="gary">其他项目经理：</span>
                                <span>${qtmanagename}</span>
                            </li>
                        </#if>
                    </ul>
                    <div class="gary">选择公示期</div>
                    <div  class="fl"  style="width: 100%;margin-top: 10px;">
                        <span class="fl">开始时间：</span>
                        <input type="text" class="fl" placeholder="选择开始时间"  name="startDate"
                               lay-verify="required"  style="width: 200px;"
                               autocomplete="off" id="startDate" lay-verify="startDate">
                    </div>
                    <div  class="fl" style="width: 100%;margin-top: 10px;">
                        <span  class="fl"> 结束时间：</span>
                        <input type="text" class="fl" placeholder="选择结束时间"
                               name="endDate"
                               lay-verify="required" style="width: 200px;"
                               autocomplete="off" id="endDate" lay-verify="endDate">
                    </div>
                    <div class="changeBtn  fl" style="margin-top: 30px;width: 80%; padding-left: 40px;">
                        <button type="button" class="blue bgnone close">关闭</button>
                        <button type="submit" lay-submit lay-filter="save" class="bluebg white ft18" id="btnsave">保存
                        </button>
                        </button>
                    </div>
                </div>
            </div>

        </form>

    </div>
</div>
<!--JQ-->
<!--公用样式JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.boot.js"></script>
<!--启动JS-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery.common.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/form.file.js"></script>

<#-- 可以多选的下拉框 -->
<script src="${re.contextPath}/plugin/layui/xm-select.js"></script>


<!-- 公共配置第三方组件 -->
<script type="text/javascript">
    layui.config({
        version: false,
        debug: false,
        base: "${re.contextPath}/plugin/layui/lay/extra/"
    })

</script>


<script>
    var layer, form, laydate, table, autocomplete;
    var _crt_page;
    var _xstjlManagerPerson;
    var _xstzxManagerPerson;
    var _xstjcManagerPerson;
    var _xstqtManagerPerson;

    layui.use(['form', 'laydate', 'layer', 'autocomplete'], function () {
        layer = layui.layer;
        form = layui.form;
        laydate = layui.laydate;

        $('.close').click(function () {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });
        form.verify({
            maxlength: function (v, item) {
                var maxlength = item.getAttribute('lay-maxlength');
                if (v.trim() != '') {
                    if (v.trim().length > maxlength) {
                        return "输入长度不能大于" + maxlength + "个字符！";
                    }
                }
            },
            phoneNumber: function (v) {
                if (v.trim() == '') {
                    return '手机号不能为空';
                } else {
                    if (!v.trim().isMobile() && !v.trim().isTel()) {
                        return '请输入正确的手机号码或电话号码\n\n例如:13916752109或0531-3614072';
                    }
                }
            },
            number: function (v) {
                var reg = /^[0-9]*$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的数字';
                }
            },
            decimal: function (v) {
                var reg = /^-?([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,10})?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    return '请输入正确的金额';
                }
            },
            perdecimal: function (v) {
                var reg = /^[1-9][0-9]*([.][0-9]+)?$/;
                var flag = reg.test(v.trim());
                if (!flag) {
                    if (v.trim() != "0" || v.trim() != 0) {
                        return '请输入数字';
                    }
                }
            }
        })
        _crt_page = {
            init: function () {
                //初始化事件
                _crt_page.events._init();
                //初始化Form
                form.on('submit(save)', _crt_page.forms.save);
                form.on('submit(submit)', _crt_page.forms.commit);
            },
            forms: {
                save: function (data) {
                    $('#btnsave').addClass("layui-btn-disabled").attr("disabled", true);
                    var istg = _crt_page.events.saveBefore(data);
                    if (istg) {
                        var supProjectId = $("#supProjectId").val();
                        data.field.supProjectId = supProjectId;
                        layerAjax('/supplier/gspubnotice/addPubNotice', data.field, '', function (d) {
                            if (d.flag == true) {
                                $('#btnsave').addClass("layui-btn-disabled").attr("disabled", true);
                                layer.msg(d.msg, {icon: 1});
                                setTimeout(_crt_page.events.closewind,2000);
                            } else {
                                $('#btnsave').removeClass("layui-btn-disabled").attr("disabled", false);
                                layer.msg(d.msg, {icon: 2});
                            }
                        });
                    }
                    return false;
                }

            },
            events: {
                _init: function () {
                    _crt_page.events.gqdateInit();

                },
                gqdateInit: function () {
                    // 工期开始时间
                    laydate.render({
                        elem: '#startDate',
                        trigger: 'click',
                        type:'datetime',
                        format: 'yyyy-MM-dd HH:mm',
                        done: function (value, date) {
                            var that = $(this.elem[0])
                            console.log(that);
                            var  endDate=$("#endDate").val();
                            if(endDate  && endDate<value){
                                layer.msg("开始时间不能大于结束时间", {icon: 2});
                                $(that).val("");
                                return ;
                            }
                        }
                    });
                    // 工期截止时间
                    laydate.render({
                        elem: '#endDate',
                        trigger: 'click',
                        type:'datetime',
                        format: 'yyyy-MM-dd HH:mm',
                        done: function (value, date) {
                            var that = $(this.elem[0])
                            var  startDate=$("#startDate").val();
                            if(startDate  && startDate>value){
                                layer.msg("结束时间不能小于开始时间", {icon: 2});
                                $(that).val("");
                                return ;
                            }
                        }
                    });

                },
                saveBefore: function (data) {
                    var isTg = true;
                    return isTg;

                },
                closewind:function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index)
                }

            }
        };
        _crt_page.init();
    });


</script>

</body>

</html>